package 对象流;

import java.io.Serializable;

//自定义类
public class Boy implements Serializable {
    //对序列的实例对象进行版本控制，不写，系统会自动生成；但是建议手写
//    public static final long serialVersionUID = 475463534532L;
    private int id;
    private String name;
    public int address = 21;
    public Boy() {
    }

    public Boy(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Boy{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }
}
